package com.lg.cms.controller.admin.template;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lg.cms.entity.Template1;
import com.lg.cms.entity.TemplateType1;
import com.lg.cms.entity.TemplateTypePath;
import com.lg.cms.entity.TemplateTypePath1;
import com.lg.cms.mapper.Template1Mapper;
import com.lg.cms.mapper.TemplateTypePath1Mapper;
import com.lg.cms.mapper.TemplateTypePathMapper;
import com.lg.cms.service.TemplateType1Service;
import com.lg.cms.service.TemplateTypePath1Service;
import com.lg.cms.service.TemplateTypeService;
import com.lg.cms.vo.LayerTableVO;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Description: 模板管理器
 * @Author: chengJiKun
 * @create: 2020-11-19 14:25
 */
@Controller
@Slf4j
@RequestMapping("/admin/templateManage")
public class TemplateManageController {

    @Autowired
    TemplateTypePath1Service typePath1Service;

    /**
     * 根据模板类型id查找所有模板
     * @param id
     * @param page
     * @param limit
     * @return
     */
    @GetMapping("/showTemplateTypes")
    public LayerTableVO<TemplateTypePath1> showTemplateTypes(Integer id, @RequestParam("page")Integer page,@RequestParam("limit") Integer limit){
        Page page1=new Page(page,limit);
        return typePath1Service.selectTemplateTypeById(id,page1);
    }


}
